package org.pc2r.protocole.message;

import org.pc2r.game.model.Position;
import org.pc2r.protocole.EnumRequest;
import org.pc2r.protocole.RequestBuilder;

public class PositionMessage extends Message {

	protected int x;
	protected int y;

	public PositionMessage(EnumRequest request, Position position) {
		super(request);
		this.x = position.getX();
		this.y = position.getY();
	}

	@Override
	public String toString() {
		StringBuilder build = new StringBuilder();
		build.append(getType()).append(RequestBuilder.SEPARATOR);
		build.append(x).append(RequestBuilder.SEPARATOR);
		build.append((char) (y + RequestBuilder.MIN_Y)).append(
				RequestBuilder.SEPARATOR);
		build.append(RequestBuilder.END);
		return build.toString();
	}

}
